﻿using System;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using EvacuationWidth.ControlLayer;
using YJKView;
using ModelCheckUtility;

namespace EvacuationWidth
{
	[Transaction(TransactionMode.Manual)]
	[Regeneration(RegenerationOption.Manual)]
	internal class CmdEvacuationWidthCheck : IExternalCommand
	{
		public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
		{
            if (!ModelCheckUtility.Utility.IfEnvironmentCanUse(commandData))
			{
				return Autodesk.Revit.UI.Result.Succeeded;
			}
			FloorSelectManager.CommandName = "CmdEvacuationWidthCheck";
			EvacuationWidthManger evacuationWidthManger = new EvacuationWidthManger(commandData);
			evacuationWidthManger.DoWork();
			return Autodesk.Revit.UI.Result.Succeeded;
		}
	}
}
